package com.wym.charging.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 包月购买记录(MonthlySubscriptionPurchaseRecord)表实体类
 *
 * @author WangYimin
 * @since 2024-12-07 19:10:43
 */
@TableName("monthly_subscription_purchase_record")
@Data
@Schema(description = "包月购买记录实体类")
public class MonthlySubscriptionPurchaseRecord extends Model<MonthlySubscriptionPurchaseRecord> {
    @TableId
    @Schema(description = "id")
    private Integer id;
    @Schema(description = "用户id")
    private Integer userId;
    @Schema(description = "花费金额")
    private BigDecimal amountSpent;
    @Schema(description = "有效期几个月")
    private Integer gearPosition;
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    @Schema(description = "假删标识")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Boolean isDel;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

